<?php
namespace User\Model;
use Think\Model;

class NiuDanModel extends Model
{
    CONST ZHONGJIANG_NO = 0;    //未中奖
    CONST ZHONGJIANG_YES = 1;   //中奖
    //CONST ZHONGJIANG_DONE = 2;  //已填写个人信息

    CONST PRIZE_ACTIVE = 1;     //奖项正常
    CONST PRIZE_DELETE = 9;     //奖项已删除

    CONST FANS_ACTIVE = 1;     //粉丝正常
    CONST FANS_DELETE = 9;     //粉丝已删除

    CONST AWARD_ACTIVE = 1;     //正常
    CONST AWARD_CHECK = 2;      //已核销
    CONST AWARD_DELETE = 9;     //已删除

    CONST STATUS_ACTIVE = 1;    //正常
    CONST STATUS_APPLY = 2;     //待发布
    CONST STATUS_STOP = 3;      //已停用
    CONST STATUS_DELETE = 9;    //已删除

    CONST ADDRESS_YES = 1;      //联系地址开启
    CONST ADDRESS_NO = 0;       //联系地址关闭

    CONST CUSTOM_TYPE1 = 0;     //自定义按钮：无
    CONST CUSTOM_TYPE2 = 1;     //自定义按钮：外链
    CONST CUSTOM_TYPE3 = 2;     //自定义按钮：一键关注

    CONST FOLLOW_YES = 1;       //强制关注是
    CONST FOLLOW_NO = 0;        //强制关注否

    CONST LEVEL1 = '一等奖';
    CONST LEVEL2 = '二等奖';
    CONST LEVEL3 = '三等奖';
    CONST LEVEL4 = '四等奖';
    CONST LEVEL5 = '五等奖';
    CONST LEVEL6 = '六等奖';
    CONST LEVEL7 = '七等奖';
    CONST LEVEL8 = '八等奖';
    CONST LEVEL9 = '九等奖';
    CONST LEVEL10 = '十等奖';
    CONST LEVEL11 = '特等奖';
    CONST LEVEL12 = '安慰奖';

    public static function getLevel($level = 'all')
    {
        $levelArr = [
            1 => self::LEVEL1,
            2 => self::LEVEL2,
            3 => self::LEVEL3,
            4 => self::LEVEL4,
            5 => self::LEVEL5,
            6 => self::LEVEL6,
            7 => self::LEVEL7,
            8 => self::LEVEL8,
            9 => self::LEVEL9,
            10 => self::LEVEL10,
            11 => self::LEVEL11,
            12 => self::LEVEL12,
        ];
        if ($level == 'all') {
            return $levelArr;
        }
        if (array_key_exists($level, $levelArr)) {
            return $levelArr[$level];
        }
        return "未知";
    }
}